/*
 * yMessage.h
 *
 *  Created on: Sep 13, 2016
 *      Author: root
 */

#ifndef BASE_NET_YMESSAGE_H_
#define BASE_NET_YMESSAGE_H_
#include "yNetBase.h"
#include "yByteArray.h"
#define DEFAULT_MESSAGE_LEN 64
class Message {
private:
	ByteArray byteArray;
public:
	Message(int opcode);
	~Message();
	void writeByte(char value);
	void writeShort(short value);
	void writeInt(int value);
	void writeLong(long value);
	void writeFloat(float value);
	void writeDouble(double value);
	void writeString(std::string &value);
	void writeBytes(char* value, int len);
	void sendToServer(connection_t ctx);
};

#endif /* BASE_NET_YMESSAGE_H_ */
